package kizzo.game 
{
	import flash.display.Sprite;
	

	public class BrushMenu extends Sprite
	{
		public var selected_brush:uint = TileState.EMPTY;
		public var brush_size:int = 0;
		
		
		private var buttons:Vector.<BrushMenuButton>;
		
		public function BrushMenu() 
		{
			this.graphics.beginFill(0x8888cc, .6);
			this.graphics.drawRect(0, 0, 600, 200);
			this.graphics.endFill();
			
			this.buttons = new Vector.<BrushMenuButton>();
			
			this.add_button(new BrushMenuButton("DELETE BRUSH", this, TileState.EMPTY));
			
			this.add_button(new BrushMenuButton("SIMPLE TILE", this, TileState.SIMPLE_TILE));
			
			this.add_button(new BrushMenuButton("MASTER CUBE", this, TileState.MASTER_CUBE));			
			this.add_button(new BrushMenuButton("MASTER GOAL", this, TileState.MASTER_GOAL));
			
			this.add_button(new BrushMenuButton("SLAVE CUBE A", this, TileState.SLAVE_CUBE_A));
			this.add_button(new BrushMenuButton("SLAVE LINK A", this, TileState.SLAVE_LINK_A));			
			this.add_button(new BrushMenuButton("SLAVE GOAL A", this, TileState.SLAVE_GOAL_A));

			this.add_button(new BrushMenuButton("SLAVE CUBE B", this, TileState.SLAVE_CUBE_B));
			this.add_button(new BrushMenuButton("SLAVE LINK B", this, TileState.SLAVE_LINK_B));			
			this.add_button(new BrushMenuButton("SLAVE GOAL B", this, TileState.SLAVE_GOAL_B));			
			
			this.add_button(new BrushMenuButton("ROT CW MOD", this, TileState.ROTATE_CLOCKWISE_MOD));
			this.add_button(new BrushMenuButton("BOOST", this, TileState.BOOST_MOD));
			this.add_button(new BrushMenuButton("NEGATOR", this, TileState.NEGATOR_TILE));

			this.add_button(new BrushMenuButton("BLOCK CUBE", this, TileState.BLOCKER_CUBE));			
			
			this.add_button(new BrushMenuButton("CRUMBLE", this, TileState.CRUMBLING_TILE));
			this.add_button(new BrushMenuButton("TELEPORT", this, TileState.TELEPORT_TILE));
			this.add_button(new BrushMenuButton("MIRROR_Z", this, TileState.MIRROR_Z));
			this.add_button(new BrushMenuButton("MIRROR_X", this, TileState.MIRROR_X));
			
			this.add_button(new BrushMenuButton("ACTIVATOR", this, TileState.ACTIVATOR));
			this.add_button(new BrushMenuButton("ACTIVATED", this, TileState.ACTIVATED));
			
			this.add_button(new BrushMenuButton("REPULSOR", this, TileState.REPULSOR));			
		}
		
		private function add_button(b:BrushMenuButton):void
		{
			b.x = ((this.buttons.length) % 5) * 120;
			b.y = int(this.buttons.length / 5) * 40;
			
			buttons.push(b);			
			this.addChild(b);

		}
	}

}